﻿CREATE TABLE [dbo].[OrderLine] (
    [Id]               INT           IDENTITY (1, 1) NOT NULL,
    [Order_Id]         INT           NOT NULL,
    [Item_Code]        NVARCHAR (20) NOT NULL,
    [Item_Description] NVARCHAR (50) NULL,
    [Item_UnitPrice]   MONEY         NOT NULL,
    [Quantity]         FLOAT (53)    NOT NULL,
    CONSTRAINT [PK_OrderLine] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_OrderLine_Item] FOREIGN KEY ([Item_Code]) REFERENCES [dbo].[Item] ([Code]),
    CONSTRAINT [FK_OrderLine_Order] FOREIGN KEY ([Order_Id]) REFERENCES [dbo].[Order] ([Id])
);

